:root{
  --bg: #eef0f2;
  --card-bg: #ffffff;
  --text-dark: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --blue-hover: #1d4ed8;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --radius: 14px;
}

*{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body{
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text-dark);
  padding: 24px;
}

.wrap{
  width: 100%;
  max-width: 400px;
}

.brand-row{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.brand-icon{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--blue-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-title{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.PapanLogin{
  position: absolute;
  top:50%;
  left:40%;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.papan-title{
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.papan-subtitle{
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

label{
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.input-wrap{
  position: relative;
  margin-bottom: 18px;
}

input{
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 16px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: var(--text-dark);
}

input:focus{
  border-color: var(--blue);
}

input[type="password"]{
  padding-right: 44px;
}

.toggle-password{
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.toggle-password i{
  font-size: 16px;
}

#formMsg{
  font-size: 12px;
  color: var(--red);
  margin: -10px 0 14px 2px;
  min-height: 16px;
  word-break: break-word;
}

.btn-submit{
  display: block;
  width: 100%;
  margin-top: 8px;
  background: var(--blue);
  color: #fff;
  border: none;
  height: 44px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease;
}

.btn-submit:hover{
  background: var(--blue-hover);
}

.btn-submit:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}

/* ====== State awal: hanya tombol Login ====== */
.gerbang-login{
  text-align: center;
}

.gerbang-login p{
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 20px;
}

/* Form disembunyikan dulu sampai tombol Login ditekan */
#loginForm{
  display: none;
}

#loginForm.tampil{
  display: block;
}

.gerbang-login.sembunyi{
  display: none;
}
